#ifndef TOOLS_H
#define TOOLS_H

#include <string>

// Various utility functions.
//---------------------------------------------------------
// ITERATION:

// Iterates over a range of items
template<class Iter, class Funct>
void for_all(Iter start, Iter end, Funct& functor);

// Double-iterates over all pairs of items in two ranges.
template<class Iter, class Funct>
void for_all_pairs(Iter start1, Iter end1,
                   Iter start2, Iter end2,
                   Funct& functor);

//---------------------------------------------------------
// Compare strings, ignoring case.
bool iequals(const std::string& s1,
             const std::string& s2);

bool iequals(const std::string& s1,
             const char *s2);

bool iequals(const char *s1,
             const char *s2);

bool iequals(const char *s1,
             const std::string& s2);
#endif
